<%@ page language="java" import="java.util.*" contentType="text/html;charset=utf-8" pageEncoding="utf-8"%>
<% request.setCharacterEncoding("utf-8"); %>
<%@ taglib prefix="c" uri="/WEB-INF/c.tld" %>
<%@ taglib prefix="fmt" uri="/WEB-INF/fmt.tld" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>Shop 管理中心 - 添加管理员</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<link href="<c:url value='/Admin/styles/general.css' />" rel="stylesheet" type="text/css" />
	<link href="<c:url value='/Admin/styles/main.css' />" rel="stylesheet" type="text/css" />
	<script language="javascript" src="<c:url value='/js/calendar.js' />"></script>
	<script type="text/javascript" src="<c:url value='/js/user.js' />"></script>
  </head>
  <body>
    <h1>
	<span class="action-span"><a href="<c:url value='/Admin/Admin_List.jsp' />">管理员列表</a></span>
	<span><a href="<c:url value='/Admin/Admin_Main.jsp ' />">Shop 管理中心</a>  - 添加管理员 </span>
	</h1>
<div class="main-div">
<form method="post" onsubmit="return checkAddAdmin();" action="<c:url value='/servlet/UserManageServlet' />" name="regUser">
<table width="100%" >
  <tr>
    <td class="label">用&nbsp;户&nbsp;名:</td>
    <td><input name="suser" type="text" maxlength="30" onblur="is_registered(this.value);" />
    	<span id="username">(必填)</span></td>
  </tr>
  <tr>
    <td class="label">密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码:</td>
    <td><input id="spwd" name="spwd" type="password" maxlength="30" onblur="check_password(this.value);" onkeyup="checkIntensity(this.value)" />
    	<span id="password">(必填)</span></td>
  </tr>
  <tr>
    <td class="label">密码强度:</td>
    <td>
    	<ul id="pwd_lower" >弱</ul>
        <ul id="pwd_middle" >中</ul>
        <ul id="pwd_high" >强</ul>
    </td>
  </tr>
  <tr>
    <td class="label">确认密码:</td>
    <td><input name="spwd2" type="password" maxlength="30" onblur="check_conform_password(this.value);" />
    	<span id="password2">(必填)</span></td>
  </tr>
  <tr>
    <td class="label">性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别:</td>
    <td><input type="radio" name="ssex" value="男" checked="checked" />&nbsp;男&nbsp;<input type="radio" name="sex" value="女" />&nbsp;女&nbsp;</td>
  </tr>
  <tr>
    <td class="label">真实姓名:</td>
    <td><input name="sname" type="text" maxlength="30" /></td>
  </tr>
  <tr>
    <td class="label">出生日期:</td>
    <td><input name="dbirth" type="text" maxlength="30" value="" onfocus="show_cele_date(this,'','',this)" onblur="checkBirth(this.value);"/>
		<span id="dbirthcheck">(必填)</span></td>
  </tr>
    <tr>
    <td class="label">电子邮箱:</td>
    <td><input name="semail" type="text" maxlength="30" onblur="checkEmail(this.value);" />
    	<span id="emailcheck">(必填)</span></td>
  </tr>
  <tr>
    <td class="label">电话号码:</td>
    <td><input name="sphone" type="text" maxlength="30" onblur="checkPhone(this.value);" />
    	<span id="phonecheck">(必填)</span></td>
  </tr>
  <tr>
    <td class="label">地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;址:</td>
    <td><input name="saddress" type="text" class="textInput" maxlength="300" /></td>
  </tr>
  <tr>
    <td class="label">邮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;编:</td>
    <td><input name="scode" type="text" class="textInput" maxlength="6" onblur="checkCode(this.value);"/>
    	<span id="codecheck">(必填)</span></td>
  </tr>
  <tr>
  	<td align="right">
  	  <input name="submit" type="submit" value="添加" class="button" />
      <input type="hidden" name="act" value="adminadd" />
      <input type="hidden" name="fromPage" value="/Admin/Admin_Add.jsp" />
    </td>
    <td align="left"><input type="reset" value=" 重置 " class="button" /></td>
  </tr>
</table>
</form>
</div>
<c:if test="${not empty param.msg}">
   	<script language="javascript">
   		alert("${param.msg}");
       	location.href="<c:url value="/Admin/Admin_Add.jsp" />";
       </script>
</c:if>
<div id="footer">版权所有 &copy;</div>
  <script language="javascript" >
  <!--
        var msg_username_empty = "<img src='/Shop/images/check_error.gif'  /> 用户名不能为空。";
		var msg_username_shorter = "<img src='/Shop/images/check_error.gif'  /> 对不起，您输入的用户名小于3个字符, 请输入一个较长的用户名。";
		var msg_username_invalid = "<img src='/Shop/images/check_error.gif'  /> 用户名非法,用户名只能包含英文字母。";
		var msg_password_empty = "<img src='/Shop/images/check_error.gif'  /> 登录密码不能为空。";
        var msg_password_shorter = "<img src='/Shop/images/check_error.gif'  /> 登录密码不能少于 3 个字符。";
        var msg_confirm_password_invalid = "<img src='/Shop/images/check_error.gif'  /> 两次输入的密码不一致，请检查后重试。 ";
        var msg_email_empty = "<img src='/Shop/images/check_error.gif'  /> 邮件地址不能为空";
        var msg_email_format = "<img src='/Shop/images/check_error.gif'  /> Email 地址无效，请返回重新填写。";
		var msg_birth_empty = "<img src='/Shop/images/check_error.gif'  /> 出生日期不能为空";
		var msg_phone_empty = "<img src='/Shop/images/check_error.gif'  /> 电话号码不能为空。";
		var msg_phone_format = "<img src='/Shop/images/check_error.gif'  /> 电话号码格式错误,请返回重新填写。";
		var msg_code_empty = "<img src='/Shop/images/check_error.gif'  /> 邮编不能为空。";
		var msg_code_format = "<img src='/Shop/images/check_error.gif'  /> 邮编只能是数字,必须是6位数。";
		var msg_can_rg = "<img src='/Shop/images/check_right.gif'  />";
		var username_empty = "用户名不能为空。";
		var username_shorter = "用户名长度不能少于 3 个字符。";
		var username_invalid = "用户名只能是英文字母。";
		var password_empty = "登录密码不能为空。";
        var password_shorter = "登录密码不能少于 3 个字符。";
        var confirm_password_invalid = "两次输入密码不一致";
		var birth_empty = "出生日期不能为空";
        var email_empty = "Email地址不能为空";
        var email_format = "Email 地址无效";
		var phone_empty = "电话号码不能为空";
		var phone_format = "电话号码格式错误";
		var code_empty = "邮编不能为空";
		var code_format = "邮编只能是6位数字";
	-->
  </script>
  </body>
</html>
